const multer = require('multer')
const storage = multer.diskStorage({
	destination:'www/uploads',
	filename:function(req,file,callback){
		var name = req.cookies.username
		var fileType = file.originalname
		var arr = fileType.split('.')
	    var headerName = name + '.' + arr[arr.length - 1]
				callback(null,headerName)
		}
       
	
})
uploads = multer({storage})

module.exports = uploads